package com.tdk.demo.controller;

import com.tdk.demo.entities.User;
import com.tdk.demo.service.DemoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping(value="/demo")
@Slf4j
public class DemoController {

	@Autowired
	private DemoService demoService;
	
	@GetMapping("/get/{id}")
	@ResponseBody
	public User get(@PathVariable("id") Integer id) {
		User user = demoService.updateState(id);
		return user;
	}
}
